//
//  Tools.m
//  block回调
//
//  Created by 李伟 on 16/1/23.
//  Copyright © 2016年 李伟. All rights reserved.
//

#import "Tools.h"

@implementation Tools

+ (void)loadAccount:(void (^)(NSDictionary *))accountBlock {
    
    NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
    
    NSString *filePath = [path stringByAppendingPathComponent:@"account.data"];
    
    // 从沙盒中读取数据
    NSDictionary *account = [NSDictionary dictionaryWithContentsOfFile:filePath];
    
    // 回调传值
    if (accountBlock) {
        
        accountBlock(account);
    }
    
}

@end
